****
****

*GET PACKAGES

ssc install shapley2
ssc install coefplot
ssc install ci2

****
****

*MAKE SP INDEX
*define value lables for these items
label define SP_label 1 "SD" 2 "D" 3 "N" 4 "A" 5 "SA"

*flip Satanic ritual sex abuse is widespread in this country (q284_3)
tab q284_3
gen ritabuse=.
replace ritabuse=1 if q284_3==5
replace ritabuse=2 if q284_3==4
replace ritabuse=3 if q284_3==3
replace ritabuse=4 if q284_3==2
replace ritabuse=5 if q284_3==1
tab q284_3 ritabuse
label values ritabuse SP_label

*flip Members of Satanic cults secretly abuse thousands of children every year (q283_4)
tab q283_4
gen cultabuse=.
replace cultabuse=1 if q283_4==5
replace cultabuse=2 if q283_4==4
replace cultabuse=3 if q283_4==3
replace cultabuse=4 if q283_4==2
replace cultabuse=5 if q283_4==1
tab q283_4 cultabuse
label values cultabuse SP_label

*flip Numerous preschools and public schools secretly engage in Satanic practices (q284_2)
tab q284_2
gen schoolsatan=.
replace schoolsatan=1 if q284_2==5
replace schoolsatan=2 if q284_2==4
replace schoolsatan=3 if q284_2==3
replace schoolsatan=4 if q284_2==2
replace schoolsatan=5 if q284_2==1
tab q284_2 schoolsatan
label values schoolsatan SP_label

*flip The Disney Corporation "grooms" children into sexualized lifestyles (q283_2)
tab q283_2
gen disneygroom=.
replace disneygroom=1 if q283_2==5
replace disneygroom=2 if q283_2==4
replace disneygroom=3 if q283_2==3
replace disneygroom=4 if q283_2==2
replace disneygroom=5 if q283_2==1
tab q283_2 disneygroom
label values disneygroom SP_label

*flip There is a secret "gay agenda" aimed at converting young people into gay and trans lifestyles (q283_3)
tab q283_3
gen gayagenda=.
replace gayagenda=1 if q283_3==5
replace gayagenda=2 if q283_3==4
replace gayagenda=3 if q283_3==3
replace gayagenda=4 if q283_3==2
replace gayagenda=5 if q283_3==1
tab q283_3 gayagenda
label values gayagenda SP_label

*flip Elites, from government and Hollywood, are engaged in a massive child sex trafficking racket (Q20_3)
tab q20_3
gen elitetraff=.
replace elitetraff=1 if q20_3==5
replace elitetraff=2 if q20_3==4
replace elitetraff=3 if q20_3==3
replace elitetraff=4 if q20_3==2
replace elitetraff=5 if q20_3==1
tab q20_3 elitetraff
label values elitetraff SP_label

*flip There is a secret agenda in the public schools to indoctrinate children into gay and trans lifestyles. (q17_7)
tab q17_7
recode q17_7 (1=5) (2=4) (3=3) (4=2) (5=1), gen(schoolgroom)
tab q17_7 schoolgroom
label values schoolgroom SP_label

*combine vars into summary index (alpha = 0.9065; PC1 expl var =  0.8468, eigen =  4.19989)
factor ritabuse cultabuse schoolsatan disneygroom gayagenda elitetraff schoolgroom, ipf
alpha ritabuse cultabuse schoolsatan disneygroom gayagenda elitetraff schoolgroom, gen(SP_ave)	
summarize SP_ave

*diagnostic for SI: corr w/ CTs
	*flip: The threat of COVID-19 has been exaggerated for political purposes. (COVCONS_1) 
recode covcons_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(covcons_1_flip)		
tab covcons_1 covcons_1_flip		
	*flip: Coronavirus was purposely created and released. (COVCONS_2) 
recode covcons_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(covcons_2_flip)	
tab covcons_2 covcons_2_flip	
	*flip: The coronavirus is being used to force a dangerous and unnecessary vaccine on Americans. (COVCONS_3) 
recode covcons_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(covcons_3_flip)	
tab covcons_3 covcons_3_flip	
	*flip: The COVID-19 virus was engineered in a lab in China. (COVCONS_4) 
recode covcons_4 (1=5) (2=4) (3=3) (4=2) (5=1), gen(covcons_4_flip)	
tab covcons_4 covcons_4_flip	
	*flip: Humans have made contact with aliens and this fact has been deliberately hidden from the public. (q17_1) 
recode q17_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q17_1_flip)	
tab q17_1 q17_1_flip
	*flip: The number of Jews killed by the Nazis during World War II has been exaggerated on purpose. (q17_2) 
recode q17_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q17_2_flip)	
tab q17_2 q17_2_flip
	*flip: The dangers of vaccines are being hidden by the medical establishment. (q17_3) 
recode q17_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q17_3_flip)	
tab q17_3 q17_3_flip	
	*flip: The dangers of genetically-modified foods are being hidden from the public. (q17_4) 
recode q17_4 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q17_4_flip)	
tab q17_4 q17_4_flip
	*flip: School shootings, like those at Sandy Hook, CT and Parkland, FL are false flag attacks perpetrated by the government. (q17_5) 
recode q17_5 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q17_5_flip)	
tab q17_5 q17_5_flip
	*flip: Climate change is a hoax perpetrated by corrupt scientists and politicians. (Q18_1) 
recode q18_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q18_1_flip)	
tab q18_1 q18_1_flip
	*flip: Barack Obama faked his citizenship to become president. (Q18_2) 
recode q18_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q18_2_flip)	
tab q18_2 q18_2_flip
	*flip: I am a believer in QAnon. (Q20_1) 
recode q20_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q20_1_flip)	
tab q20_1 q20_1_flip
	*flip: There is a "deep state" embedded in the government that operates in secret and without oversight. (Q20_2) 
recode q20_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q20_2_flip)	
tab q20_2 q20_2_flip
	*flip: Joe Biden won the presidential election through voter fraud. (Q21_1) 
recode q21_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q21_1_flip)	
tab q21_1 q21_1_flip
	*flip: Elections in this country are often rigged. (Q21_2) 
recode q21_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q21_2_flip)	
tab q21_2 q21_2_flip
	*flip: The COVID-19 vaccine causes infertility in women and the government is covering this up. (q283_1) 
recode q283_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q283_1_flip)	
tab q283_1 q283_1_flip
	*flip: Corporations secretly poison our food. (q284_1)
recode q284_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q284_1_flip)	
tab q284_1 q284_1_flip
	
	*run corr analyses
pwcorr SP_ave covcons_1_flip, sig	
pwcorr SP_ave covcons_2_flip, sig	
pwcorr SP_ave covcons_3_flip, sig	
pwcorr SP_ave covcons_4_flip, sig	
pwcorr SP_ave q17_1_flip, sig	
pwcorr SP_ave q17_2_flip, sig	
pwcorr SP_ave q17_3_flip, sig	
pwcorr SP_ave q17_4_flip, sig	
pwcorr SP_ave q17_5_flip, sig	
pwcorr SP_ave q18_1_flip, sig	
pwcorr SP_ave q18_2_flip, sig	
pwcorr SP_ave q20_1_flip, sig	
pwcorr SP_ave q20_2_flip, sig	
pwcorr SP_ave q21_1_flip, sig	
pwcorr SP_ave q21_2_flip, sig	
pwcorr SP_ave q283_1_flip, sig	
pwcorr SP_ave q284_1_flip, sig	

	*run some of the above w/ cis for Fig 1
		*Human/alien contect deliberately hidden
ci2 SP_ave q17_1_flip, corr
		*Joe Biden won due to voter fraud
ci2 SP_ave q21_1_flip, corr
		*QAnon
ci2 SP_ave q20_1_flip, corr
		*Holocaust purposely exaggerated
ci2 SP_ave q17_2_flip, corr
		*Obama faked citizenship
ci2 SP_ave q18_2_flip, corr
		*Elections are often rigged
ci2 SP_ave q21_2_flip, corr
		*Climate change is a hoax
ci2 SP_ave q18_1_flip, corr
		*Coronavirus purposely created/released
ci2 SP_ave covcons_2_flip, corr
		*Deep state
ci2 SP_ave q20_2_flip, corr
		*School shootings are false flag attacks
ci2 SP_ave q17_5_flip, corr
		*Coronavirus being used to force vaccine
ci2 SP_ave covcons_3_flip, corr
		*Medical establishment hiding vaccine dangers
ci2 SP_ave q17_3_flip, corr
		*Corporations secretly poison our food
ci2 SP_ave q284_1_flip, corr
		*COVID-19 vaccine secretly causes infertility
ci2 SP_ave q283_1_flip, corr
	

	*find % agree/strongly agree w/ each CT
		*The threat of COVID-19 has been exaggerated for political purposes. (COVCONS_1) 
tab covcons_1	
		*Coronavirus was purposely created and released. (COVCONS_2) 
tab covcons_2
		*The coronavirus is being used to force a dangerous and unnecessary vaccine on Americans. (COVCONS_3) 
tab covcons_3	
		*The COVID-19 virus was engineered in a lab in China. (COVCONS_4) 
tab covcons_4	
		*Humans have made contact with aliens and this fact has been deliberately hidden from the public. (q17_1) 
tab q17_1
		*The number of Jews killed by the Nazis during World War II has been exaggerated on purpose. (q17_2) 
tab q17_2
		*The dangers of vaccines are being hidden by the medical establishment. (q17_3) 
tab q17_3	
		*The dangers of genetically-modified foods are being hidden from the public. (q17_4) 
tab q17_4
		*School shootings, like those at Sandy Hook, CT and Parkland, FL are false flag attacks perpetrated by the government. (q17_5) 
tab q17_5
		*Climate change is a hoax perpetrated by corrupt scientists and politicians. (Q18_1) 
tab q18_1
		*Barack Obama faked his citizenship to become president. (Q18_2) 
tab q18_2
		*I am a believer in QAnon. (Q20_1) 
tab q20_1
		*There is a "deep state" embedded in the government that operates in secret and without oversight. (Q20_2) 
tab q20_2
		*Joe Biden won the presidential election through voter fraud. (Q21_1) 
tab q21_1
		*Elections in this country are often rigged. (Q21_2) 
tab q21_2
		*The COVID-19 vaccine causes infertility in women and the government is covering this up. (q283_1) 
tab q283_1
		*Corporations secretly poison our food. (q284_1)
tab q284_1				
		
				
****
****

*CLEAN AND CREATE IVs FOR MODEL OF SP_AVE
	
*sex (q2)
tab q2
gen female=.
replace female=1 if q2==2
replace female=0 if q2==1
tab q2 female
label variable female "Female" 

*hispanic (q4)
tab q4
gen hispanic=.
replace hispanic=1 if q4==1
replace hispanic=0 if q4==2
tab q4 hispanic
label variable hispanic "Latinx" 

*race (q3)
	*white
tab q3_1
gen white=0
replace white=1 if q3_1==1
tab q3_1 white
label variable white "White" 
	*black
tab q3_2
gen black=0
replace black=1 if q3_2==1
tab q3_2 black
label variable black "Black" 
	*asian, PI
tab q3_3
gen asian=0
replace asian=1 if q3_3==1
tab q3_3 asian
label variable asian "Asian" 
	*native am
tab q3_4
gen natamer=0
replace natam=1 if q3_4==1
tab q3_4 natamer
label variable natamer "Native Am." 
	*other
tab q3_5
gen race_oth=0
replace race_oth=1 if q3_5==1
tab q3_5 race_oth
label variable race_oth "Race, Other"

*income (q5)
tab q5
gen income=q5
tab q5 income
label variable income "Income" 

*education (q6)
tab q6
gen educ=q6
tab q6 educ
label variable educ "Education" 

*age, from year born (q7)
gen age=2022-q7
summarize age
label variable age "Age"
	*make groupings for demog table
gen agegroup=.
replace agegroup=1 if age<=24
replace agegroup=2 if (age>24 & age<=44)
replace agegroup=3 if (age>44 & age<=64)
replace agegroup=4 if (age>=65)
tab agegroup

*gen 7-point party id (q9-12) to run DEM-REP
gen demrep7=.
replace demrep7=1 if q11==1
replace demrep7=2 if q11==2
replace demrep7=3 if q12==2
replace demrep7=4 if q12==3
replace demrep7=5 if q12==1
replace demrep7=6 if q10==2
replace demrep7=7 if q10==1
tab demrep7
tab demrep7 q11
tab demrep7 q10
tab demrep7 q12
label variable demrep7 "Party ID (Dem-Rep)"

*fold pid for intensity
gen pid7_str=.
replace pid7_str=4 if demrep7==1
replace pid7_str=3 if demrep7==2
replace pid7_str=2 if demrep7==3
replace pid7_str=1 if demrep7==4
replace pid7_str=2 if demrep7==5
replace pid7_str=3 if demrep7==6
replace pid7_str=4 if demrep7==7
label variable pid7_str "Partisan Strength" 
tab demrep7 pid7_str

*label ideology (q13)
tab q13
gen libcon=q13
label variable libcon "Ideology (Lib-Con)"
tab q13 libcon

*fold ideo for intensity
gen ideo_str=.
replace ideo_str=4 if libcon==1
replace ideo_str=3 if libcon==2
replace ideo_str=2 if libcon==3
replace ideo_str=1 if libcon==4
replace ideo_str=2 if libcon==5
replace ideo_str=3 if libcon==6
replace ideo_str=4 if libcon==7
label variable ideo_str "Ideological Strength"
tab libcon ideo_str

*flip I closely follow what's going on in government and current events (q40_2)
tab q40_2
gen followpol=.
replace followpol=1 if q40_2==5
replace followpol=2 if q40_2==4
replace followpol=3 if q40_2==3
replace followpol=4 if q40_2==2
replace followpol=5 if q40_2==1
label variable followpol "Follows Politics"
tab q40_2 followpol

*make anti establishment scale
	*confirm there is a single dimension
factor ctscale_1 ctscale_2 ctscale_3 ctscale_4 antiest_1 antiest_2 antiest_3 antiest_4 antiest_5, pcf
	*flip Even though we live in a democracy, a few people will always run things anyway. (CTSCALE_1) 
gen few_people=.
replace few_people=1 if ctscale_1==5
replace few_people=2 if ctscale_1==4
replace few_people=3 if ctscale_1==3
replace few_people=4 if ctscale_1==2
replace few_people=5 if ctscale_1==1
tab ctscale_1 few_people
	*flip The people who really "run" the country, are not known to the voters. (CTSCALE_2) 
gen really_run=.
replace really_run=1 if ctscale_2==5
replace really_run=2 if ctscale_2==4
replace really_run=3 if ctscale_2==3
replace really_run=4 if ctscale_2==2
replace really_run=5 if ctscale_2==1
tab ctscale_2 really_run
	*flip Big events like wars, the recent recession... (CTSCALE_3)
gen big_events=.
replace big_events=1 if ctscale_3==5
replace big_events=2 if ctscale_3==4
replace big_events=3 if ctscale_3==3
replace big_events=4 if ctscale_3==2
replace big_events=5 if ctscale_3==1
tab ctscale_3 big_events
	*flip Much of our lives are being controlled by plots hatched in secret places. (CTSCALE_4) 
gen secret_plots=.
replace secret_plots=1 if ctscale_4==5
replace secret_plots=2 if ctscale_4==4
replace secret_plots=3 if ctscale_4==3
replace secret_plots=4 if ctscale_4==2
replace secret_plots=5 if ctscale_4==1
tab ctscale_4 secret_plots
	*flip Elected officials talk too much and take too little action. (ANTIEST_1) 
gen talk_much=.
replace	talk_much=1 if antiest_1==5
replace	talk_much=2 if antiest_1==4
replace	talk_much=3 if antiest_1==3
replace	talk_much=4 if antiest_1==2
replace	talk_much=5 if antiest_1==1
tab antiest_1 talk_much		
	*flip What people call "compromise" in politics is really just selling out on one's principles. (ANTIEST_2) 
gen sell_out=.
replace	sell_out=1 if antiest_2==5
replace	sell_out=2 if antiest_2==4
replace	sell_out=3 if antiest_2==3
replace	sell_out=4 if antiest_2==2
replace	sell_out=5 if antiest_2==1
tab antiest_2 sell_out
	*flip Established politicians who claim to defend our interests only take care of themselves (ANTIEST_3) 
gen estab_pols=.
replace	estab_pols=1 if antiest_3==5
replace	estab_pols=2 if antiest_3==4
replace	estab_pols=3 if antiest_3==3
replace	estab_pols=4 if antiest_3==2
replace	estab_pols=5 if antiest_3==1
tab antiest_3 estab_pols		
	*flip The established elite and politicians have often betrayed the people. (ANTIEST_4) 
gen betray_people=.
replace	betray_people=1 if antiest_4==5
replace	betray_people=2 if antiest_4==4
replace	betray_people=3 if antiest_4==3
replace	betray_people=4 if antiest_4==2
replace	betray_people=5 if antiest_4==1
tab antiest_4 betray_people
	*flip Politics is a battle between good and evil. (ANTIEST_5) 
gen good_evil=.
replace	good_evil=1 if antiest_5==5
replace	good_evil=2 if antiest_5==4
replace	good_evil=3 if antiest_5==3
replace	good_evil=4 if antiest_5==2
replace	good_evil=5 if antiest_5==1
tab antiest_5 good_evil		
	*combine
factor few_people really_run big_events secret_plots talk_much sell_out estab_pols betray_people good_evil, ipf
alpha few_people really_run big_events secret_plots talk_much sell_out estab_pols betray_people good_evil, gen(antiestab)
label variable antiestab "Anti-Establishment"
tab antiestab

*make religiocity
	*flip importance of religion (q14)
tab q14
gen relig_imp=.
replace relig_imp=1 if q14==4
replace relig_imp=2 if q14==3
replace relig_imp=3 if q14==2
replace relig_imp=4 if q14==1
tab q14 relig_imp
	*flip rate of attendence (note: data are missing, but no DKs selected)
tab q15
gen relig_freq=.
replace relig_freq=1 if q15==6
replace relig_freq=2 if q15==5
replace relig_freq=3 if q15==4
replace relig_freq=4 if q15==3
replace relig_freq=5 if q15==2
replace relig_freq=6 if q15==1
tab q15 relig_freq
	*flip frequency of prayer (code n = 36 dk as 1)
tab q16
gen freq_prayer=.
replace freq_prayer=1 if q16==8
replace freq_prayer=1 if q16==7
replace freq_prayer=2 if q16==6
replace freq_prayer=3 if q16==5
replace freq_prayer=4 if q16==4
replace freq_prayer=5 if q16==3
replace freq_prayer=6 if q16==2
replace freq_prayer=7 if q16==1
tab q16 freq_prayer
	*combine
		*make all 0-1 since on diff scales (NOTE: this rescales the vars, so re-run the recodes if you want original scales)
foreach var of varlist relig_imp relig_freq freq_prayer ///
{
		qui sum `var'
		replace `var' = (`var' - `r(min)') / (`r(max)'-`r(min)')
	}		
			*check the above
sum relig_imp relig_freq freq_prayer
		*factor and make index
factor relig_imp relig_freq freq_prayer, ipf
alpha relig_imp relig_freq freq_prayer, gen(religiosity)
label variable religiosity "Religiosity"
tab religiosity

*flip: The government can be trusted. (Q45_2)
recode q45_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(govtrust)		
label variable govtrust "Trust in Government"
tab q45_2 govtrust

*make need for chaos
	*flip I fantasize about a natural disaster wiping out most of humanity such that a small group of people can start all over. (Q46_1) 
tab q46_1
gen q46_1_flip=.
replace q46_1_flip=1 if q46_1==5
replace q46_1_flip=2 if q46_1==4
replace q46_1_flip=3 if q46_1==3
replace q46_1_flip=4 if q46_1==2
replace q46_1_flip=5 if q46_1==1
tab q46_1 q46_1_flip
	*flip I think society should be burned to the ground. (Q46_2) 
tab q46_2
gen q46_2_flip=.
replace q46_2_flip=1 if q46_2==5
replace q46_2_flip=2 if q46_2==4
replace q46_2_flip=3 if q46_2==3
replace q46_2_flip=4 if q46_2==2
replace q46_2_flip=5 if q46_2==1
tab q46_2 q46_2_flip
	*flip When I think about our political institutions, I cannot help thinking "just let them all burn." (Q46_3) 
tab q46_3
gen q46_3_flip=.
replace q46_3_flip=1 if q46_3==5
replace q46_3_flip=2 if q46_3==4
replace q46_3_flip=3 if q46_3==3
replace q46_3_flip=4 if q46_3==2
replace q46_3_flip=5 if q46_3==1
tab q46_3 q46_3_flip	
	*flip We cannot fix the problems in our society, we need to tear it down and start over. (Q46_4) 
tab q46_4
gen q46_4_flip=.
replace q46_4_flip=1 if q46_4==5
replace q46_4_flip=2 if q46_4==4
replace q46_4_flip=3 if q46_4==3
replace q46_4_flip=4 if q46_4==2
replace q46_4_flip=5 if q46_4==1
tab q46_4 q46_4_flip
	*flip I need chaos around me - it is too boring if nothing is going on. (Q46_5) 
tab q46_5
gen q46_5_flip=.
replace q46_5_flip=1 if q46_5==5
replace q46_5_flip=2 if q46_5==4
replace q46_5_flip=3 if q46_5==3
replace q46_5_flip=4 if q46_5==2
replace q46_5_flip=5 if q46_5==1
tab q46_5 q46_5_flip
	*flip Sometimes I just feel like destroying beautiful things. (Q46_6) 
tab q46_6
gen q46_6_flip=.
replace q46_6_flip=1 if q46_6==5
replace q46_6_flip=2 if q46_6==4
replace q46_6_flip=3 if q46_6==3
replace q46_6_flip=4 if q46_6==2
replace q46_6_flip=5 if q46_6==1
tab q46_6 q46_6_flip
	*combine
factor q46_1_flip q46_2_flip q46_3_flip q46_4_flip q46_5_flip q46_6_flip, ipf
alpha q46_1_flip q46_2_flip q46_3_flip q46_4_flip q46_5_flip q46_6_flip, gen(need4chaos)
label variable need4chaos "Need for Chaos"
tab need4chaos
	
*make dark tetrad
	*flip I tend to manipulate others to get my way. (MACH_1) 
gen mach1=.
replace mach1=1 if mach_1==5
replace mach1=2 if mach_1==4
replace mach1=3 if mach_1==3
replace mach1=4 if mach_1==2
replace mach1=5 if mach_1==1
tab mach_1 mach1
	*flip I have used deceit or lied to get my way. (MACH_2) 
gen mach2=.
replace mach2=1 if mach_2==5
replace mach2=2 if mach_2==4
replace mach2=3 if mach_2==3
replace mach2=4 if mach_2==2
replace mach2=5 if mach_2==1
tab mach_2 mach2
	*flip I have used flattery to get my way. (MACH_3) 
gen mach3=.
replace mach3=1 if mach_3==5
replace mach3=2 if mach_3==4
replace mach3=3 if mach_3==3
replace mach3=4 if mach_3==2
replace mach3=5 if mach_3==1
tab mach_3 mach3
	*flip I tend to exploit others towards my own end. (MACH_4) 
gen mach4=.
replace mach4=1 if mach_4==5
replace mach4=2 if mach_4==4
replace mach4=3 if mach_4==3
replace mach4=4 if mach_4==2
replace mach4=5 if mach_4==1
tab mach_4 mach4
	*flip I tend to want others to admire me. (NARC_1) 
gen narc1=.
replace narc1=1 if narc_1==5
replace narc1=2 if narc_1==4
replace narc1=3 if narc_1==3
replace narc1=4 if narc_1==2
replace narc1=5 if narc_1==1
tab narc_1 narc1
	*flip I tend to want others to pay attention to me. (NARC_2) 
gen narc2=.
replace narc2=1 if narc_2==5
replace narc2=2 if narc_2==4
replace narc2=3 if narc_2==3
replace narc2=4 if narc_2==2
replace narc2=5 if narc_2==1
tab narc_2 narc2		
	*flip I tend to seek prestige or status. (NARC_3) 
gen narc3=.
replace narc3=1 if narc_3==5
replace narc3=2 if narc_3==4
replace narc3=3 if narc_3==3
replace narc3=4 if narc_3==2
replace narc3=5 if narc_3==1
tab narc_3 narc3
	*flip I tend to expect special favors from others. (NARC_4) 
gen narc4=.
replace narc4=1 if narc_4==5
replace narc4=2 if narc_4==4
replace narc4=3 if narc_4==3
replace narc4=4 if narc_4==2
replace narc4=5 if narc_4==1
tab narc_4 narc4
	*flip I tend to lack remorse. (PSYC_1) 
gen psyc1=.
replace psyc1=1 if psyc_1==5
replace psyc1=2 if psyc_1==4
replace psyc1=3 if psyc_1==3
replace psyc1=4 if psyc_1==2
replace psyc1=5 if psyc_1==1
tab psyc_1 psyc1
	*flip I tend to be unconcerned with the morality of my actions. (PSYC_2) 
gen psyc2=.
replace psyc2=1 if psyc_2==5
replace psyc2=2 if psyc_2==4
replace psyc2=3 if psyc_2==3
replace psyc2=4 if psyc_2==2
replace psyc2=5 if psyc_2==1
tab psyc_2 psyc2
	*flip I tend to be callous or insensitive. (PSYC_3) 
gen psyc3=.
replace psyc3=1 if psyc_3==5
replace psyc3=2 if psyc_3==4
replace psyc3=3 if psyc_3==3
replace psyc3=4 if psyc_3==2
replace psyc3=5 if psyc_3==1
tab psyc_3 psyc3
	*flip I tend to be cynical. (PSYC_4) 
gen psyc4=.
replace psyc4=1 if psyc_4==5
replace psyc4=2 if psyc_4==4
replace psyc4=3 if psyc_4==3
replace psyc4=4 if psyc_4==2
replace psyc4=5 if psyc_4==1
tab psyc_4 psyc4
	*flip It's funny when idiots fall flat on their face. (SADISM_1) 
recode sadism_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(sadism1)
tab sadism_1 sadism1
	*flip Some people deserve to suffer. (SADISM_2) 
recode sadism_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(sadism2)
tab sadism_2 sadism2
	*flip Just for kicks, I've said mean things on social media. (SADISM_3) 
recode sadism_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(sadism3)
tab sadism_3 sadism3	
	*flip I know how to hurt someone with words alone. (SADISM_4) 
recode sadism_4 (1=5) (2=4) (3=3) (4=2) (5=1), gen(sadism4)
tab sadism_4 sadism4
	*combine
factor mach1-mach4 narc1-narc4 psyc1-psyc4 sadism1-sadism4, ipf
alpha mach1-mach4 narc1-narc4 psyc1-psyc4 sadism1-sadism4, gen(darktetrad)
label variable darktetrad "Dark Tetrad"
tab darktetrad

*make legacy news media index (q95 series)
	*flip Network TV news (q95_1)
gen q95_1_flip=.
replace q95_1_flip=1 if q95_1==5
replace q95_1_flip=2 if q95_1==4
replace q95_1_flip=3 if q95_1==3
replace q95_1_flip=4 if q95_1==2
replace q95_1_flip=5 if q95_1==1
tab q95_1 q95_1_flip	
	*flip Cable TV news (q95_2) 
gen q95_2_flip=.
replace q95_2_flip=1 if q95_2==5
replace q95_2_flip=2 if q95_2==4
replace q95_2_flip=3 if q95_2==3
replace q95_2_flip=4 if q95_2==2
replace q95_2_flip=5 if q95_2==1
tab q95_2 q95_2_flip	
	*flip Local TV news (q95_3) 
gen q95_3_flip=.
replace q95_3_flip=1 if q95_3==5
replace q95_3_flip=2 if q95_3==4
replace q95_3_flip=3 if q95_3==3
replace q95_3_flip=4 if q95_3==2
replace q95_3_flip=5 if q95_3==1
tab q95_3 q95_3_flip	
	*flip Print newspapers (q95_4) 
gen q95_4_flip=.
replace q95_4_flip=1 if q95_4==5
replace q95_4_flip=2 if q95_4==4
replace q95_4_flip=3 if q95_4==3
replace q95_4_flip=4 if q95_4==2
replace q95_4_flip=5 if q95_4==1
tab q95_4 q95_4_flip	
	*flip Radio (q95_5) 
gen q95_5_flip=.
replace q95_5_flip=1 if q95_5==5
replace q95_5_flip=2 if q95_5==4
replace q95_5_flip=3 if q95_5==3
replace q95_5_flip=4 if q95_5==2
replace q95_5_flip=5 if q95_5==1
tab q95_5 q95_5_flip
	*combine into summary index
factor q95_1_flip q95_2_flip q95_3_flip q95_4_flip q95_5_flip, ipf
alpha q95_1_flip q95_2_flip q95_3_flip q95_4_flip q95_5_flip, gen(leg_media)
label variable leg_media "Legacy News Media Use" 
tab leg_media

*new news media (q96 series)
	*look for dimensions (note: PC1 explains 70% of variance)
factor q96_1 q96_2 q96_3 q96_4 q96_5 q96_6 q96_7 q96_8 q96_9 q96_10 q96_11 q96_12, ipf
	*flip Online newspapers (Q96_1) 
gen q96_1_flip=.
replace q96_1_flip=1 if q96_1==5
replace q96_1_flip=2 if q96_1==4
replace q96_1_flip=3 if q96_1==3
replace q96_1_flip=4 if q96_1==2
replace q96_1_flip=5 if q96_1==1
tab q96_1 q96_1_flip	
	*flip Online news magazines (Q96_2) 
gen q96_2_flip=.
replace q96_2_flip=1 if q96_2==5
replace q96_2_flip=2 if q96_2==4
replace q96_2_flip=3 if q96_2==3
replace q96_2_flip=4 if q96_2==2
replace q96_2_flip=5 if q96_2==1
tab q96_2 q96_2_flip	
	*flip Blogs (Q96_3) 
gen q96_3_flip=.
replace q96_3_flip=1 if q96_3==5
replace q96_3_flip=2 if q96_3==4
replace q96_3_flip=3 if q96_3==3
replace q96_3_flip=4 if q96_3==2
replace q96_3_flip=5 if q96_3==1
tab q96_3 q96_3_flip
	*flip YouTube (Q96_4) 
gen q96_4_flip=.
replace q96_4_flip=1 if q96_4==5
replace q96_4_flip=2 if q96_4==4
replace q96_4_flip=3 if q96_4==3
replace q96_4_flip=4 if q96_4==2
replace q96_4_flip=5 if q96_4==1
tab q96_4 q96_4_flip
	*flip Facebook (Q96_5) 
gen q96_5_flip=.
replace q96_5_flip=1 if q96_5==5
replace q96_5_flip=2 if q96_5==4
replace q96_5_flip=3 if q96_5==3
replace q96_5_flip=4 if q96_5==2
replace q96_5_flip=5 if q96_5==1
tab q96_5 q96_5_flip
	*flip Twitter (Q96_6) 
gen q96_6_flip=.
replace q96_6_flip=1 if q96_6==5
replace q96_6_flip=2 if q96_6==4
replace q96_6_flip=3 if q96_6==3
replace q96_6_flip=4 if q96_6==2
replace q96_6_flip=5 if q96_6==1
tab q96_6 q96_6_flip	
	*flip Reddit (Q96_7) 
gen q96_7_flip=.
replace q96_7_flip=1 if q96_7==5
replace q96_7_flip=2 if q96_7==4
replace q96_7_flip=3 if q96_7==3
replace q96_7_flip=4 if q96_7==2
replace q96_7_flip=5 if q96_7==1
tab q96_7 q96_7_flip
	*flip Instagram (Q96_8) 
gen q96_8_flip=.
replace q96_8_flip=1 if q96_8==5
replace q96_8_flip=2 if q96_8==4
replace q96_8_flip=3 if q96_8==3
replace q96_8_flip=4 if q96_8==2
replace q96_8_flip=5 if q96_8==1
tab q96_8 q96_8_flip
	*flip TV news websites (e.g., CNN.com, FoxNews.com) (Q96_9) 
gen q96_9_flip=.
replace q96_9_flip=1 if q96_9==5
replace q96_9_flip=2 if q96_9==4
replace q96_9_flip=3 if q96_9==3
replace q96_9_flip=4 if q96_9==2
replace q96_9_flip=5 if q96_9==1
tab q96_9 q96_9_flip
	*flip 8Kun (Q96_10) 
gen q96_10_flip=.
replace q96_10_flip=1 if q96_10==5
replace q96_10_flip=2 if q96_10==4
replace q96_10_flip=3 if q96_10==3
replace q96_10_flip=4 if q96_10==2
replace q96_10_flip=5 if q96_10==1
tab q96_10 q96_10_flip	
	*flip Telegram (Q96_11) 
gen q96_11_flip=.
replace q96_11_flip=1 if q96_11==5
replace q96_11_flip=2 if q96_11==4
replace q96_11_flip=3 if q96_11==3
replace q96_11_flip=4 if q96_11==2
replace q96_11_flip=5 if q96_11==1
tab q96_11 q96_11_flip
	*flip Truth Social (Q96_12) 
gen q96_12_flip=.
replace q96_12_flip=1 if q96_12==5
replace q96_12_flip=2 if q96_12==4
replace q96_12_flip=3 if q96_12==3
replace q96_12_flip=4 if q96_12==2
replace q96_12_flip=5 if q96_12==1
tab q96_12 q96_12_flip
	*combine into summary index
factor q96_1_flip q96_2_flip q96_3_flip q96_4_flip q96_5_flip q96_6_flip q96_7_flip q96_8_flip q96_9_flip q96_10_flip q96_11_flip q96_12_flip, ipf
alpha q96_1_flip q96_2_flip q96_3_flip q96_4_flip q96_5_flip q96_6_flip q96_7_flip q96_8_flip q96_9_flip q96_10_flip q96_11_flip q96_12_flip, gen(new_media)
label variable new_media "Online News Media Use" 
tab new_media

*new news media (q96 series): NOW SPLIT THIS INTO MAINSTREAM AND FRINGE
	*mainstream	(online newspapers; Online news magazines; blogs; youtube: facebook; twitter; insta; TV news websites); eigen = 3.46, prop = .72; alpha = .84
factor q96_1_flip q96_2_flip q96_3_flip q96_4_flip q96_5_flip q96_6_flip q96_8_flip q96_9_flip, ipf
alpha q96_1_flip q96_2_flip q96_3_flip q96_4_flip q96_5_flip q96_6_flip q96_8_flip q96_9_flip, gen(new_media_main)
label variable new_media_main "Online News Media, Mainstream"
tab new_media_main
	*fringe (reddit; 8kun; telegram; truth social); eigen = 2.44, prop = .95, alpha = .84
factor q96_7_flip q96_10_flip q96_11_flip q96_12_flip, ipf
alpha q96_7_flip q96_10_flip q96_11_flip q96_12_flip, gen(new_media_fringe)
label variable new_media_fringe "Online News Media, Fringe"
tab new_media_fringe

*has children @ home (q32)
tab q32
gen haskids=.
replace haskids=1 if q32==1
replace haskids=0 if q32==2
tab q32 haskids
label variable haskids "Has Children at Home" 

*Christian nationalism (q48 series)
	*flip The federal government should declare the United States a Christian nation. (Q48_1) 
gen q48_1_flip=.
replace q48_1_flip=1 if q48_1==5
replace q48_1_flip=2 if q48_1==4
replace q48_1_flip=3 if q48_1==3
replace q48_1_flip=4 if q48_1==2
replace q48_1_flip=5 if q48_1==1
tab q48_1 q48_1_flip
	*flip The federal government should advocate Christian values. (Q48_2) 
gen q48_2_flip=.
replace q48_2_flip=1 if q48_2==5
replace q48_2_flip=2 if q48_2==4
replace q48_2_flip=3 if q48_2==3
replace q48_2_flip=4 if q48_2==2
replace q48_2_flip=5 if q48_2==1
tab q48_2 q48_2_flip	
	*flip The federal government should enforce strict separation of church and state. (Q48_3) 
		*DO NOT FLIP
	*flip The success of the United States is part of God's plan. (Q48_4) 
gen q48_4_flip=.
replace q48_4_flip=1 if q48_4==5
replace q48_4_flip=2 if q48_4==4
replace q48_4_flip=3 if q48_4==3
replace q48_4_flip=4 if q48_4==2
replace q48_4_flip=5 if q48_4==1
tab q48_4 q48_4_flip
	*flip The federal government should allow prayer in public schools. (Q48_5) 
gen q48_5_flip=.
replace q48_5_flip=1 if q48_5==5
replace q48_5_flip=2 if q48_5==4
replace q48_5_flip=3 if q48_5==3
replace q48_5_flip=4 if q48_5==2
replace q48_5_flip=5 if q48_5==1
tab q48_5 q48_5_flip
	*combine into summary index
factor q48_1_flip q48_2_flip q48_3 q48_4_flip q48_5_flip, ipf
alpha q48_1_flip q48_2_flip q48_3 q48_4_flip q48_5_flip, gen(christ_nat)
label variable christ_nat "Christian Nationalism" 
tab christ_nat	

*paranoia (q74 series)
	*flip Certain people have it in for me. (Q74_1) 
gen q74_1_flip=.
replace q74_1_flip=1 if q74_1==5
replace q74_1_flip=2 if q74_1==4
replace q74_1_flip=3 if q74_1==3
replace q74_1_flip=4 if q74_1==2
replace q74_1_flip=5 if q74_1==1
tab q74_1 q74_1_flip
	*flip There is a conspiracy against me. (Q74_2) 
gen q74_2_flip=.
replace q74_2_flip=1 if q74_2==5
replace q74_2_flip=2 if q74_2==4
replace q74_2_flip=3 if q74_2==3
replace q74_2_flip=4 if q74_2==2
replace q74_2_flip=5 if q74_2==1
tab q74_2 q74_2_flip
	*flip People are persecuting me. (Q74_3) 
gen q74_3_flip=.
replace q74_3_flip=1 if q74_3==5
replace q74_3_flip=2 if q74_3==4
replace q74_3_flip=3 if q74_3==3
replace q74_3_flip=4 if q74_3==2
replace q74_3_flip=5 if q74_3==1
tab q74_3 q74_3_flip
	*combine into summary index
factor q74_1_flip q74_2_flip q74_3_flip, ipf
alpha q74_1_flip q74_2_flip q74_3_flip, gen(paranoia)
label variable paranoia "Paranoia" 
tab paranoia	

*male normativity (q71 series)
	*flip Men should be able to fix most things around the house. (Q71_1) 
gen q71_1_flip=.
replace q71_1_flip=1 if q71_1==5
replace q71_1_flip=2 if q71_1==4
replace q71_1_flip=3 if q71_1==3
replace q71_1_flip=4 if q71_1==2
replace q71_1_flip=5 if q71_1==1
tab q71_1 q71_1_flip
	*flip Men should always like to have sex. (Q71_2) 
gen q71_2_flip=.
replace q71_2_flip=1 if q71_2==5
replace q71_2_flip=2 if q71_2==4
replace q71_2_flip=3 if q71_2==3
replace q71_2_flip=4 if q71_2==2
replace q71_2_flip=5 if q71_2==1
tab q71_2 q71_2_flip
	*flip Homosexual men should never kiss in public. (Q71_3) 
gen q71_3_flip=.
replace q71_3_flip=1 if q71_3==5
replace q71_3_flip=2 if q71_3==4
replace q71_3_flip=3 if q71_3==3
replace q71_3_flip=4 if q71_3==2
replace q71_3_flip=5 if q71_3==1
tab q71_3 q71_3_flip
	*flip Boys should prefer to play with trucks rather than dolls. (Q71_4) 
gen q71_4_flip=.
replace q71_4_flip=1 if q71_4==5
replace q71_4_flip=2 if q71_4==4
replace q71_4_flip=3 if q71_4==3
replace q71_4_flip=4 if q71_4==2
replace q71_4_flip=5 if q71_4==1
tab q71_4 q71_4_flip
	*combine into summary index
factor q71_1_flip q71_2_flip q71_3_flip q71_4_flip, ipf
alpha q71_1_flip q71_2_flip q71_3_flip q71_4_flip, gen(male_norm)
label variable male_norm "Male Role Normativity" 
tab male_norm	

*scientific knowledge, Q85 correct answers of 1-6 make a scale (sclit series)
	*code 1= correct, 0 = incorrect
recode scilit_1 (1=0) (2=1), gen(sciknow1)
tab scilit_1 sciknow1
recode scilit_2 (1=1) (2=0), gen(sciknow2)
tab scilit_2 sciknow2
recode scilit_3 (1=0) (2=1), gen(sciknow3)
tab scilit_3 sciknow3
recode scilit_4 (1=0) (2=1), gen(sciknow4)
tab scilit_4 sciknow4
recode scilit_5 (1=1) (2=0), gen(sciknow5)
tab scilit_5 sciknow5
recode scilit_6 (1=1) (2=0), gen(sciknow6)
tab scilit_6 sciknow6
	*combine into a count of correct responses
gen sci_lit=sciknow1+sciknow2+sciknow3+sciknow4+sciknow5+sciknow6
tab sci_lit
	*label
label variable sci_lit "Scientific Literacy"

*Anti-Intellectualism, Q86 1-7 (not with 8 and 9), make a scale; coded hi-low on trust so no flip
	*reduce (alpha = 0.9152)
factor trust_exp trust_eco trust_sci trust_doc trust_leg trust_prf trust_fin, ipf
alpha trust_exp trust_eco trust_sci trust_doc trust_leg trust_prf trust_fin, gen(anti_intel)
tab anti_intel
	*label
label variable anti_intel "Anti-Intellectualism"

*Q84 I have confidence in the scientific community.
	*flip
recode q84 (1=5) (2=4) (3=3) (4=2) (5=1), gen(sci_conf)
tab q84 sci_conf
	*label
label variable sci_conf "Confidence in Sci. Community"

*RW Authoritarianism, Q43 series
	*flip: God's laws about abortion, pornography, and marriage must be strictly followed before it is too late. (Q43_1) 
recode q43_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q43_1_flip)
tab q43_1 q43_1_flip
	*keep as-is: There is nothing wrong with premarital sexual intercourse. (Q43_2) 
	*flip: Our society needs stricter laws. (Q43_3) 
recode q43_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q43_3_flip)
tab q43_3 q43_3_flip
	*flip: Crime and the recent public disorders show that we have to crack down harder on troublemakers, if we are going preserve law and order. (Q43_4) 
recode q43_4 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q43_4_flip)
tab q43_4 q43_4_flip	
	*reduce (alpha =  0.6642)
factor q43_1_flip q43_2 q43_3_flip q43_4_flip, ipf
alpha q43_1_flip q43_2 q43_3_flip q43_4_flip, gen(rw_auth)
tab rw_auth
	*label
label variable rw_auth "Right-Wing Authoritarianism"

*LW Authoritarianism, Q42
	*flip: The rich should be stripped of their belongings and status. (Q42_1) 
recode q42_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q42_1_flip)
tab q42_1 q42_1_flip
	*flip: Rich people should be forced to give up most of their wealth. (Q42_2) 
recode q42_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q42_2_flip)
tab q42_2 q42_2_flip	
	*flip: If I could remake society, I would put people who currently have the most privilege at the very bottom. (Q42_3) 
recode q42_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q42_3_flip)
tab q42_3 q42_3_flip	
	*reduce
factor q42_1_flip q42_2_flip q42_3_flip, ipf
alpha q42_1_flip q42_2_flip q42_3_flip, gen (lw_auth)
tab lw_auth
	*label
label variable lw_auth "Left-Wing Authoritarianism"

*National Narcissism, Q59
	*flip all 3
recode q59_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q59_1_flip)
tab q59_1 q59_1_flip
recode q59_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q59_2_flip)
tab q59_2 q59_2_flip
recode q59_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q59_3_flip)
tab q59_3 q59_3_flip
	*reduce (alpha =  0.8006)
factor q59_1_flip q59_2_flip q59_3_flip, ipf
alpha q59_1_flip q59_2_flip q59_3_flip, gen (nat_narc)
tab nat_narc
	*label
label variable nat_narc "National Narcissism"

*Dogmatism, Q61
	*flip all 3
recode q61_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q61_1_flip)
tab q61_1 q61_1_flip
recode q61_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q61_2_flip)
tab q61_2 q61_2_flip
recode q61_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q61_3_flip)
tab q61_3 q61_3_flip
	*reduce (alpha =   0.6928)
factor q61_1_flip q61_2_flip q61_3_flip, ipf
alpha q61_1_flip q61_2_flip q61_3_flip, gen (dogmatic)
tab dogmatic
	*label
label variable dogmatic "Dogmatism"

*Gendered Nationalism, Q101
	*flip all 3
recode q101_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q101_1_flip)
tab q101_1 q101_1_flip
recode q101_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q101_2_flip)
tab q101_2 q101_2_flip
recode q101_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q101_3_flip)
tab q101_3 q101_3_flip
	*reduce (alpha =  0.8590)
factor q101_1_flip q101_2_flip q101_3_flip, ipf
alpha q101_1_flip q101_2_flip q101_3_flip, gen(gen_nat)
tab gen_nat
	*label
label variable gen_nat "Gendered Nationalism"

*Denialism, Q83 1-4 (not 5) scale
	*flip all 4
recode q83_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q83_1_flip)
tab q83_1 q83_1_flip
recode q83_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q83_2_flip)
tab q83_2 q83_2_flip
recode q83_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q83_3_flip)
tab q83_3 q83_3_flip
recode q83_4 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q83_4_flip)
tab q83_4 q83_4_flip
	*reduce (alpha =  0.8218)
factor q83_1_flip q83_2_flip q83_3_flip q83_4_flip, ipf
alpha q83_1_flip q83_2_flip q83_3_flip q83_4_flip, gen(denialism)
tab denialism
	*label
label variable denialism "Denialism"

*Patternicity, Q76
	*flip all 3
recode q76_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q76_1_flip)
tab q76_1 q76_1_flip
recode q76_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q76_2_flip)
tab q76_2 q76_2_flip
recode q76_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q76_3_flip)
tab q76_3 q76_3_flip
	*reduce (alpha =   0.8201)
factor q76_1_flip q76_2_flip q76_3_flip, ipf
alpha q76_1_flip q76_2_flip q76_3_flip, gen(pattern)
tab pattern
	*label
label variable pattern "Patternicity"

*PANAS-GEN affect battery
	*positive: Interested (Q75_1); Excited (Q75_3); Strong (Q75_5); Enthusiastic (Q288_4);
	*Proud (Q288_5); Alert (Q289_2); Inspired (Q289_4); Determined (Q290_1); Attentive (Q290_2); Active (Q290_4)
		*reduce (alpha =  0.8395); factor and find alpha, but the protocol is to add them up
factor q75_1 q75_3 q75_5 q288_4 q288_5 q289_2 q289_4 q290_1 q290_2 q290_4, ipf
alpha q75_1 q75_3 q75_5 q288_4 q288_5 q289_2 q289_4 q290_1 q290_2 q290_4
gen pos_affect=q75_1+q75_3+q75_5+q288_4+q288_5+q289_2+q289_4+q290_1+q290_2+q290_4
tab pos_affect
		*label
label variable pos_affect "Positive Affect"
	*negative: Distressed (Q75_2); Upset (Q75_4); Guilty (Q288_1); Scared (Q288_2); Hostile (Q288_3) 
	*Irritable (Q289_1); Ashamed (Q289_3); Nervous (Q289_5); Jittery (Q290_3); Afraid (Q290_5) 
		*reduce (alpha =  0.8820); factor and find alpha, but the protocol is to add them up
factor q75_2 q75_4 q288_1 q288_2 q288_3 q289_1 q289_3 q289_5 q290_3 q290_5, ipf
alpha q75_2 q75_4 q288_1 q288_2 q288_3 q289_1 q289_3 q289_5 q290_3 q290_5
gen neg_affect=q75_2+q75_4+q288_1+q288_2+q288_3+q289_1+q289_3+q289_5+q290_3+q290_5
tab neg_affect
		*label
label variable neg_affect "Negative Affect"
	*correlate the two
pwcorr pos_affect neg_affect, sig

*Numeracy, Q77, 78, 79
	*reduce (alpha = 0.8086)
factor q77 q78 q79, ipf
alpha q77 q78 q79, gen(numeracy)
tab numeracy
	*label
label variable numeracy "Subjective Numeracy"

*Schizotypy (q73 series)
	*flip: I often have the sense that some person or force is around me, even though I cannot see anyone. (Q73_1) 
recode q73_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q73_1_flip)		
tab q73_1 q73_1_flip	
	*flip: Sometimes I am sure that other people can tell what I am thinking. (Q73_2) 
recode q73_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q73_2_flip)		
tab q73_2 q73_2_flip	
	*flip: I often interpret events or objects as special signs meant for me. (Q73_3) 
recode q73_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q73_3_flip)		
tab q73_3 q73_3_flip	
	*flip: When shopping, I often get the feeling that other people are taking notice of me. (Q73_4) 
recode q73_4 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q73_4_flip)		
tab q73_4 q73_4_flip	
	*flip: I have had experiences with having a sixth sense. (Q73_5) 
recode q73_5 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q73_5_flip)		
tab q73_5 q73_5_flip	
	*combine
factor q73_1_flip q73_2_flip q73_3_flip q73_4_flip q73_5_flip, ipf
alpha q73_1_flip q73_2_flip q73_3_flip q73_4_flip q73_5_flip, gen(schizotypy)
label variable schizotypy "Schizotypy"
tab schizotypy

****
****

*MODEL SP_ave

*correlations (report in SI)
pwcorr SP_ave female white income educ age haskids ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st govtrust ///
antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic schizotypy ///
male_norm gen_nat ///
pattern numeracy ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism, sig
	
*modeling ave index of SP beliefs
reg SP_ave female white income educ age haskids ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st govtrust ///
antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic schizotypy ///
male_norm gen_nat ///
pattern numeracy ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism
	*VIF (report in SI)
vif

*R2 decomp of the above
shapley2, stat(r2) group("need4chaos darktetrad rw_auth lw_auth paranoia dogmatic schizotypy nat_narc, sci_lit anti_intel sci_conf denialism, antiestab govtrust, male_norm gen_nat, religiosity christ_nat, female white income educ age haskids, leg_media new_media_main new_media_fringe followpol , pos_affect neg_affect, pattern numeracy, demrep7 libcon pid7_str ideo_st")

*descriptives all (report in SI)
estpost summarize SP_ave female white income educ age haskids ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st govtrust ///
antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic schizotypy ///
male_norm gen_nat ///
pattern numeracy ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism, quietly
esttab using "SP_descritives.rtf", cells("count mean(fmt(2)) sd(fmt(2)) min max") replace

*make a table for SI w/ SP_ave and the 6 constituent vars as DVs (NOT doing standardized here)
	*SP_ave index
reg SP_ave female white income educ age haskids ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st govtrust ///
antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic schizotypy ///
male_norm gen_nat ///
pattern numeracy ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism
est store mod1
	*ritabuse
reg ritabuse female white income educ age haskids ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st govtrust ///
antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic schizotypy ///
male_norm gen_nat ///
pattern numeracy ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism
est store mod2
	*cultabuse
reg cultabuse female white income educ age haskids ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st govtrust ///
antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic schizotypy ///
male_norm gen_nat ///
pattern numeracy ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism
est store mod3
	*schoolsatan
reg schoolsatan female white income educ age haskids ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st govtrust ///
antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic schizotypy ///
male_norm gen_nat ///
pattern numeracy ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism
est store mod4
	*disneygroom
reg disneygroom female white income educ age haskids ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st govtrust ///
antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic schizotypy ///
male_norm gen_nat ///
pattern numeracy ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism
est store mod5
	*gayagenda
reg gayagenda female white income educ age haskids ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st govtrust ///
antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic schizotypy ///
male_norm gen_nat ///
pattern numeracy ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism
est store mod6
	*elitetraff
reg elitetraff female white income educ age haskids ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st govtrust ///
antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic schizotypy ///
male_norm gen_nat ///
pattern numeracy ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism
est store mod7
	*elitetraff
reg schoolgroom female white income educ age haskids ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st govtrust ///
antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic schizotypy ///
male_norm gen_nat ///
pattern numeracy ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism
est store mod8

	*make table
esttab mod1 mod2 mod3 mod4 mod5 mod6 mod7 mod8 using "SP_regtable.rtf", ///
	cells(b(star fmt(3)) se(par fmt(3))) legend label ///
	varlabels(_cons Constant) stats(r2_a aic N, fmt(3 0 1)) ///
	replace

*FIGURE
	*center the vars to make std coeffs in coefplot
preserve
center SP_ave female white income educ age haskids ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st govtrust ///
antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic schizotypy ///
male_norm gen_nat ///
pattern numeracy ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism, inplace standardize
	*run model
reg SP_ave female white income educ age haskids ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st govtrust ///
antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic schizotypy ///
male_norm gen_nat ///
pattern numeracy ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism, noconstant
		*plot 
coefplot, drop(_cons) xline(0, lcolor(black) lwidth(thin) lpattern(dash)) sort(, descending) xtitle("standardized linear regression coefficient") graphregion(fcolor(white)) ylabel(,labsize(small)) xlabel(,labsize(small))
restore

****
****

*BELIEFS CORRELATED w/ SP

*flip Powerful politicians and corporate leaders are trying to replace white people in the U.S. with cheaper foreign laborers. (Q26_1) 
recode q26_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q26_1_flip)	
tab q26_1 q26_1_flip

*flip In the last 20 years, the government has deliberately discriminated against white Americans with its immigration policies. (Q24_3) 
recode q24_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q24_3_flip)	
tab q24_3 q24_3_flip

*flip The government is deliberately hiding the truth about how many immigrants live in this country. (Q24_1) 
recode q24_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q24_1_flip)	
tab q24_1 q24_1_flip
	
*flip The government is deliberately hiding the true cost of immigration to taxpayers and society. (Q24_2) 
recode q24_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q24_2_flip)	
tab q24_2 q24_2_flip

*flip Immigration from Asia should be limited due to the coronavirus pandemic. (Q25_2)
recode q25_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q25_2_flip)	
tab q25_2 q25_2_flip

*flip Immigrants from Asia have a positive impact on the United States. (Q25_1) 
recode q25_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q25_1_flip)	
tab q25_1 q25_1_flip

*flip Russian President Vladimir Putin did the right thing by invading Ukraine. (Q22_1) 
recode q22_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q22_1_flip)	
tab q22_1 q22_1_flip
	
*flip The Russian invasion of Ukraine is largely the fault of U.S. policies. (Q22_2) 
recode q22_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q22_2_flip)	
tab q22_2 q22_2_flip
	
*leave as-is: FT Vladimir Putin (q37_22)	
	
*flip The United States should aid Ukraine against Russia. (Q22_3) 
recode q22_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q22_3_flip)	
tab q22_3 q22_3_flip
	
*Roe v. Wade should be overturned? (Q285)
tab q285
	*make 1 = yes, 0 = no or "not sure"
gen end_roe=.
replace end_roe=1 if q285==1
replace end_roe=0 if q285==2
replace end_roe=0 if q285==3
label variable end_roe "Overturn Roe"
tab q285 end_roe

*belief on number of children being trafficked (q100)
tab q100
	*for appendix: look at how each category on this var relates to the DV
label define q100_label 6 "dk" 5 "much less" 4 "less" 3 "around 300k" 2 "higher" 1 "much higher"
label values q100 q100_label
label variable q100 "Est. of Child Trafficking"
anova SP_ave q100
margins q100
marginsplot
	*above suggests flip scale to run dk - much higher
gen num_traff=.
replace num_traff=6 if q100==1
replace num_traff=5 if q100==2
replace num_traff=4 if q100==3
replace num_traff=3 if q100==4
replace num_traff=2 if q100==5
replace num_traff=1 if q100==6
tab q100 num_traff
label define traff_label 1 "dk" 2 "much less" 3 "less" 4 "around 300k" 5 "higher" 6 "much higher"
label variable num_traff "Est. of Child Trafficking (low-high)"
label values num_traff traff_label
anova SP_ave num_traff
margins num_traff
marginsplot

*leave as-is: Proud Boys (q287_18)
*leave as-is: White Nationalists (q287_19)
*leave as-is: Antifa (q287_20)
*leave as-is: FT Donald Trump (q37_4)
*leave as-is: FT Joe Biden (q37_15)

*run corr analyses (use "ci2" to get the ci's)
ci2 SP_ave q26_1_flip, corr
ci2 SP_ave q24_3_flip, corr
ci2 SP_ave q24_1_flip, corr
ci2 SP_ave q24_2_flip, corr
ci2 SP_ave q25_2_flip, corr
ci2 SP_ave q25_1_flip, corr
ci2 SP_ave q22_1_flip, corr
ci2 SP_ave q22_2_flip, corr
ci2 SP_ave q37_22, corr
ci2 SP_ave q22_3_flip, corr
ci2 SP_ave end_roe, corr
ci2 SP_ave num_traff, corr
ci2 SP_ave q287_18, corr
ci2 SP_ave q287_19, corr
ci2 SP_ave q287_20, corr
ci2 SP_ave q37_4, corr
ci2 SP_ave q37_15, corr

****
****

*CORRELATE SP w/ BEHAVIORS

*If violence is called for in our politics, I am ready. (Q99_3) 
recode q99_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q99_3_flip)	
tab q99_3 q99_3_flip

*Violence is sometimes an acceptable way for Americans to express their disagreement with the government. (Q99_1) 
recode q99_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q99_1_flip)	
tab q99_1 q99_1_flip

*If needed to reach important objectives, the use of violence is acceptable. (Q99_2) 
recode q99_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q99_2_flip)	
tab q99_2 q99_2_flip

*leave as-is (scored lo-hi): Committed violence for a political cause (Q39_6) 

*flip Q94 I share information on social media about politics even though I believe it may be false. 
tab q94
gen share_false=.
replace share_false=1 if q94==5
replace share_false=2 if q94==4
replace share_false=3 if q94==3
replace share_false=4 if q94==2
replace share_false=5 if q94==1
label variable share_false "Shares False Info Online"
tab q94 share_false

*flip I like to argue online with other people. (Q49_1) 
recode q49_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q49_1_flip)	
tab q49_1 q49_1_flip

*interpersonal conflict (q50/CONFLICT_ series)
	*make them all 0 = no, 1 = yes (drop the first 3 in the battery to fix the scale)
recode conflict_3 (1=1) (2=0), gen(con_3_01)
recode conflict_4 (1=1) (2=0), gen(con_4_01)
recode conflict_5 (1=1) (2=0), gen(con_5_01)
recode conflict_6 (1=1) (2=0), gen(con_6_01)
recode conflict_7 (1=1) (2=0), gen(con_7_01)
recode conflict_8 (1=1) (2=0), gen(con_8_01)
	*look at latent structure	
factor con_3_01 con_4_01 con_5_01 con_6_01 con_7_01 con_8_01, ipf
alpha con_3_01 con_4_01 con_5_01 con_6_01 con_7_01 con_8_01
	*make a count of the things they do
egen conflict = rowtotal(con_3_01 con_4_01 con_5_01 con_6_01 con_7_01 con_8_01)
tab conflict

*Post links to political stories or articles for others to read. (Q92_1) 
recode q92_1 (1=1) (2=0), gen(q92_1_01)	
tab q92_1 q92_1_01

*flip I enjoy a good argument over a controversial issue. (Q49_2) 
recode q49_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q49_2_flip)	
tab q49_2 q49_2_flip

*Repost content about political or social issues originally posted by someone else. (Q92_3) 
recode q92_3 (1=1) (2=0), gen(q92_3_01)	
tab q92_3 q92_3_01

*Post your own thoughts or comments on political issues. (Q92_2) 
recode q92_2 (1=1) (2=0), gen(q92_2_01)	
tab q92_2 q92_2_01

*Comment on someone else's link, photo, or status update related to political issues. (Q92_4) 
recode q92_4 (1=1) (2=0), gen(q92_4_01)	
tab q92_4 q92_4_01

*flip I am willing to express my opinion online even if others strongly disagree with me. (Q49_3) 
recode q49_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q49_3_flip)	
tab q49_3 q49_3_flip

*Q88 Do you ever post on social media?
recode q88 (1=1) (2=0), gen(q88_01)	
tab q88 q88_01

*flip At some point in the future, I might want to run for political office. (Q38_1) 
gen run_office=.
replace run_office=1 if q38_1==5
replace run_office=2 if q38_1==4
replace run_office=3 if q38_1==3
replace run_office=4 if q38_1==2
replace run_office=5 if q38_1==1
tab q38_1 run_office

*leave as-is (scored lo-hi): Engaged in civil disobedience (Q39_5) 

*flip Overall, I feel very qualified to run for public office. (Q38_2) 
gen qual_office=.
replace qual_office=1 if q38_2==5
replace qual_office=2 if q38_2==4
replace qual_office=3 if q38_2==3
replace qual_office=4 if q38_2==2
replace qual_office=5 if q38_2==1
tab q38_2 qual_office

*leave as-is (scored lo-hi): Taken part in a protest or demonstration (Q39_1) 

*leave as-is (scored lo-hi): Volunteered during an election (Q39_4) 

*leave as-is (scored lo-hi): Attended a political meeting (Q39_2) 

*leave as-is (scored lo-hi): Contacted an elected official (Q39_3) 

*flip People like me can influence government. (Q40_1) 
recode q40_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q40_1_flip)	
tab q40_1 q40_1_flip

*Q104 Do you currently, or have you ever, owned crypto-currency?
recode q104 (1=1) (2=0), gen(has_crypto)
tab q104 has_crypto

*covid vax: Q28 Have you personally received at least one dose of a COVID-19 vaccine? (recode 1 = 7 0 = n)
gen yes_vax=.
replace yes_vax=0 if q28==2
replace yes_vax=1 if q28==1
tab q28 yes_vax
pwcorr SP_ave yes_vax
ttest SP_ave, by(yes_vax)

*run corr analyses (use "ci2" to get the ci's)
ci2 SP_ave q99_3_flip, corr
ci2 SP_ave q99_1_flip, corr
ci2 SP_ave q99_2_flip, corr
ci2 SP_ave q39_6, corr
ci2 SP_ave share_false, corr
ci2 SP_ave q49_1_flip, corr
ci2 SP_ave conflict, corr
ci2 SP_ave q92_1_01, corr
ci2 SP_ave q49_2_flip, corr
ci2 SP_ave q92_3_01, corr
ci2 SP_ave q92_2_01, corr
ci2 SP_ave q92_4_01, corr
ci2 SP_ave q49_3_flip, corr
ci2 SP_ave q88_01, corr
ci2 SP_ave run_office, corr
ci2 SP_ave q39_5, corr
ci2 SP_ave qual_office, corr
ci2 SP_ave q39_1, corr
ci2 SP_ave q39_4, corr
ci2 SP_ave q39_2, corr 
ci2 SP_ave q39_3, corr
ci2 SP_ave q40_1_flip, corr
ci2 SP_ave has_crypto, corr
ci2 SP_ave yes_vax, corr
